#include "StdAfx.h"
#include "Frame.h"

namespace TipTepOpenNI {

Frame::Frame(int stride, int width, int height, openni::DepthPixel* pDepth):
stride(stride), width(width), height(height)
{
	data = gcnew array<short^>(width * height);

	for (int y = 0; y < height; ++y)
		{
			for (int x = 0; x < width; ++x, ++pDepth)
			{
				if (*pDepth != 0)
				{
					data[y * width + x] = (short)*pDepth;
				}
			}
		}
}

array<short^>^ Frame::GetData()
{
	return data;
}

int Frame::GetStride()
{
	return stride;
}

int Frame::GetWidth()
{
	return width;
}

int Frame::GetHeight()
{
	return height;
}

}